package com.mdlib.helper.module.account.fragments;

import android.view.View;
import android.widget.LinearLayout;

import com.ljlib.core.base.BaseFragment;
import com.ljlib.help.R;
import com.mdlib.helper.model.AccountModel;

import butterknife.Bind;
import butterknife.OnClick;

/**
 * 作者：HQY on 16/12/8 10:35
 * 邮箱：hqy_xz@126.com
 */

public class SelectRoleFragment extends BaseFragment {


    @Bind(R.id.ll_select_role_send)
    LinearLayout mLlSelectRoleSend;
    @Bind(R.id.ll_select_role_run)
    LinearLayout mLlSelectRoleRun;

    public static SelectRoleFragment newInstance() {
        return new SelectRoleFragment();
    }

    @Override
    protected int getLayoutId() {
        return R.layout.fragment_select_role;
    }

    @Override
    protected void initView(View rootView) {
        super.initView(rootView);
    }


    @OnClick({R.id.ll_select_role_send, R.id.ll_select_role_run})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.ll_select_role_send:
                showLogin("user");
                break;
            case R.id.ll_select_role_run:
                showLogin("run");
                break;
        }
    }

    public void showLogin(String roleType) {
        AccountModel.getInstance().setRoleType(roleType);
        AccountModel.getInstance().writeToCache();
        addFragment(LoginFragment.newInstance());

    }
}
